﻿using System;
using System.Collections.Generic;


namespace Core.Data
{
    /// <summary>
    /// 数据设置
    /// </summary>
    public partial class DataSettings
    {
        #region 构造函数
        public DataSettings()
        {
            RawDataSettings = new Dictionary<string, string>();
        }
        #endregion

        #region Field

        /// <summary>
        /// 数据服务提供商
        /// </summary>
        public string DataProvider { get; set; }
        /// <summary>
        /// 数据链接字符串
        /// </summary>
        public string DataConnectionString { get; set; }
        public IDictionary<string, string> RawDataSettings { get; private set; }
        #endregion

        #region Method
        /// <summary>
        /// 数据内容验证
        /// </summary>
        /// <returns></returns>
        public bool IsValid()
        {
            return !String.IsNullOrEmpty(this.DataProvider) && !String.IsNullOrEmpty(this.DataConnectionString);
        }
        #endregion
    }
}
